package com.web.servlet;

import com.web.entity.Grade;
import com.web.service.GradeService;
import com.web.serviceimpl.GradeServiceImpl;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 根据班级和科目查询班级成绩
 * @author 12270
 */
@WebServlet("/scgs")
public class SearchClassGradeServlet extends HttpServlet{
    
    GradeService gradeService = new GradeServiceImpl();
    
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {

        String className = req.getParameter("className");
        String courseName = req.getParameter("courseName");

        List<Grade> list = gradeService.findClassGrade(className, courseName);
        
        req.setAttribute("classgrade", list);
        req.getRequestDispatcher("SearchClassGrade.jsp").forward(req, resp);
    }
}
